/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sadhar.sipp.jenisbarang;

import java.util.Map;
import org.sadhar.errhandler.ClassAntiNull;
import org.zkoss.zul.Listbox;
import org.sadhar.sia.framework.ClassApplicationModule;

import org.zkoss.zul.Textbox;
import org.zkoss.zul.Window;

/**
 *
 * @author Yohan Hardinugroho
 */
public class JenisBarangPopupOnPerekamanAnggaranBiayaRapatKerjaWnd extends ClassApplicationModule {

    private Textbox txtboxJenisBarangSearch;
    private Listbox lstboxJenisBarang;

    public void onCreate() throws Exception {
        lstboxJenisBarang = (Listbox) getFellow("lstboxJenisBarang");
        txtboxJenisBarangSearch = (Textbox) getFellow("txtboxJenisBarangSearch");

    }

    public void lstboxJenisBarangOnSelect() throws Exception {
        Window w = (Window) this.getParent();
        Textbox txtboxJenisSearch = (Textbox) w.getFellow("txtboxJenisSearch");
        Textbox txtboxIdJenis = (Textbox) w.getFellow("txtboxIdJenis");

        Map m = (Map) lstboxJenisBarang.getSelectedItem().getValue();
        txtboxJenisSearch.setValue(ClassAntiNull.AntiNullString(m.get("jenisBarang")));
        txtboxIdJenis.setValue(ClassAntiNull.AntiNullIntString(m.get("idJenisBarang")));

        this.detach();
    }

    
}
